﻿using System.Linq.PageList;
using Dyao.Book.Contract;

namespace Dyao.Book.Application.Abstractions
{
    public interface IBookSourceSettingApplication
    {
        /// <summary>
        /// 分页获取书源信息
        /// </summary>
        /// <param name="pageFilter">分页筛选器</param>
        /// <param name="cancellationToken">取消操作的通知</param>
        /// <returns>书籍信息</returns>
        Task<IPageList<BookSourceSettingResultDto>> GetPageListAsync(IPageFilter<BookSourceSettingFilterDto> pageFilter, CancellationToken cancellationToken = default);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<string> AddAsync(BookSourceSettingInfoDto setting, CancellationToken cancellationToken = default);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<string> ModifyAsync(BookSourceSettingInfoDto setting, CancellationToken cancellationToken = default);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<string> DeleteAsync(string id, CancellationToken cancellationToken = default);

        /// <summary>
        /// 启用
        /// </summary>
        /// <param name="id">编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<string> SwitchEnableAsync(string id, CancellationToken cancellationToken = default);
    }
}
